import time

from selenium import webdriver
from selenium.webdriver.common.by import By

drive = webdriver.Chrome()
drive.maximize_window()
drive.get("https://iviewui.com/view-ui-plus/component/form/radio")
drive.find_elements(By.XPATH, "//input[@class='ivu-radio-input' and @type='radio']")[1].click()
time.sleep(3)
drive.find_elements(By.XPATH, "//input[@class='ivu-radio-input' and @type='radio']")[2].click()
time.sleep(3)
drive.find_elements(By.XPATH, "//input[@class='ivu-radio-input' and @type='radio']")[3].click()
time.sleep(3)
# 通过text()定位
# drive.find_elements(By.XPATH,"//span[text()='Apple']")[0].click()
time.sleep(3)
# 同级兄弟元素定位
drive.find_element(By.XPATH, "//span[text()='Android']/preceding-sibling::span/input").click()
time.sleep(3)
drive.close()
